package itsm.isperp.module.repository.incident;

import itsm.isperp.framework.data.domain.DataResponse;
import itsm.isperp.framework.data.mybatis.dao.CUDMapper;
import itsm.isperp.framework.web.request.JqGridRequest;
import itsm.isperp.module.entity.incident.IcdCategory;
import itsm.isperp.module.entity.incident.IcdIncident;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 事件数据映射器
 * 
 * @author lizx
 * 
 */
@Repository
public interface IcdIncidentMapper extends CUDMapper<IcdIncident> {

	/**
	 * 查找类似事件
	 * 
	 * @param ciid
	 * @param userId
	 * @param categoryid
	 * @param title
	 * @return 列表
	 */
	public List<IcdIncident> getSimilarIncident(String ciid, String userId,
			String categoryid, String title);
	
	public DataResponse<IcdIncident> findProjectByRequest(JqGridRequest request);

	/**
	 * 按条件查询事件
	 * 
	 * @param 用户id
	 * @return 项目列表
	 */
	public DataResponse<Map<String, Object>> searchAllByFilter(
			JqGridRequest request);

	/**
	 * 
	 * @return
	 */
	public List<Map<String, Object>> findIncidentInDict(
			@Param("dictColumn") String dictColumn, JqGridRequest req);

	/**
	 * 
	 * @return
	 */
	public List<Map<String, Object>> findIncidentInProject(JqGridRequest req);

	/**
	 * 
	 * @return
	 */
	public List<Map<String, Object>> findIncidentSLA(JqGridRequest req);

	/**
	 * 
	 * @param ciId
	 * @return
	 */
	public IcdCategory findCategoryByCiId(@Param("ciId") String ciId);
	
	/**
	 * 解决人满意度统计
	 * 
	 * @return
	 */
	public List<Map<String, Object>> findSolverSatisfaction();
	
	public DataResponse<Map<String, Object>> findIncidentTotalByRequest(
			JqGridRequest request);
	
	DataResponse<Map<String, Object>> findIncidentWithPropertyMapByRequest(
			@Param("tb_search") String tb_search,
			JqGridRequest request);
	
	/*
	 * 工作报告查询事件
	 */
	public DataResponse<Map<String, Object>> findOrderIncident(
			JqGridRequest request);
	public DataResponse<Map<String, Object>> findCheckinIncident(
			JqGridRequest request);
	public DataResponse<Map<String, Object>> findSolutionIncident(
			JqGridRequest request);
	public DataResponse<Map<String, Object>> findNotFinishIncident(
			JqGridRequest request);

}
